<!DOCTYPE HTML>
<html>
<!--_meta 作为公共模版分离出去-->
{include file="common/_meta"}
<!--/meta 作为公共模版分离出去-->

<body>
<!--_header 作为公共模版分离出去-->
{include file="common/_header"}
<!--/_header 作为公共模版分离出去-->
<!--_menu 作为公共模版分离出去-->
{include file="common/_menu"}
<!--/_menu 作为公共模版分离出去-->



<section class="Hui-article-box">
       <!--_nav 作为公共模版分离出去-->
{include file="common/_nav"}
<!--/_nav 作为公共模版分离出去-->
<div class="Hui-article">
<article class="cl pd-20">
        <form action="" method="post" class="form form-horizontal" id="form-admin-edit">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>管理员名称：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" class="input-text" value="{$data.admin_name}"  id="adminName" name="adminName" >
                </div>
                <span class="aspan  c-red"></span>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>笔名：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" class="input-text" value="{$data.pen_name}" id="penName" name="penName">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>邮箱：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" class="input-text" value="{$data.email}" name="email" id="email">
                </div>
                <span class="espan  c-red"></span>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">组别：</label>
                <div class="formControls col-xs-8 col-sm-2"> <span class="select-box" style="width:150px;">
                    <select class="select" name="adminRole" size="1">
                        {foreach $rolename as  $k=>$op}
                        <option value="{$k}" {eq name="data.role_id" value="$k"}selected{/eq}>{$op}</option>
                        {/foreach}
                    </select>
                    </span> 
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>是否启用：</label>
                <div class="formControls col-xs-8 col-sm-2 skin-minimal">
                    <div class="radio-box">
                        <input name="isban" type="radio" id="sex-1" value="0"  {eq name="data.isban" value="0"}checked{/eq} >
                        <label for="sex-1">启用</label>
                    </div>
                    <div class="radio-box">
                        <input name="isban" type="radio" id="sex-2" value="1" {eq name="data.isban" value="1"}checked{/eq} >
                        <label for="sex-2">不启用</label>
                    </div>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">备注：</label>
                <div class="formControls col-xs-8 col-sm-4">
                    <textarea id="note" name="note" cols="" rows="" class="textarea"   dragonfly="true" onKeyUp="textarealength(this,200)">{$data.note}</textarea>
                    <p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
                </div>
            </div>
            <div class="row cl">
                <div class="col-xs-8 col-sm-4 col-xs-offset-1 col-sm-offset-1">
                    <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                    <input class="btn btn-default radius" type="button" value="&nbsp;&nbsp;取消&nbsp;&nbsp;" onClick="window.history.back();">                    
                </div>
            </div>
        </form>
    </article>
</div>
</section>

<!--_footer 作为公共模版分离出去-->
{include file="common/_footer" /}
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript">

$(function(){
    $("#form-admin-edit").submit(function(){
        var adminName=$("#adminName").val();
        var email =$("#email").val();
        var note = $("#note").val();
        
        if(!checkEmpty(adminName,'.aspan','用户名不能为空!'))  return false;
        
        if( !emailFormat(email) ){
            $(".espan").html("邮箱格式不对");
            return false;
        }else{
            $(".espan").html("");
        }

        if(getblen(note)>200){
            layer.msg('备注过长',{icon:5,time:1000});
            return false;
        }
    })  
})

function textarealength(obj,toplength){
    var note =$(obj).val();
    var blen = getblen(note);

    if(blen<=toplength){
        $(".textarea-length").html(blen);
    }else{
        $(".textarea-length").css('color','red');
        $(".textarea-length").html(blen);
    }
}

</script>
<!--请在上方写此页面业务相关的脚本--> 

</body>
</html>